package com.example.common.config;

import apijson.NotNull;
import apijson.RequestMethod;
import apijson.framework.APIJSONFunctionParser;
import apijson.framework.APIJSONParser;
import apijson.orm.JSONRequest;
import com.alibaba.fastjson.JSONObject;

import javax.servlet.http.HttpSession;

import static apijson.RequestMethod.GET;

public class IcpFunctionParser extends APIJSONFunctionParser {

    public static final String TAG = "FunctionParser";

    public IcpFunctionParser() {
        this(null, null, 0, null, null);
    }
    public IcpFunctionParser(RequestMethod method, String tag, int version, com.alibaba.fastjson.JSONObject request, HttpSession session) {
        super(method, tag, version, request, session);
    }

    public Object testRcf(@NotNull JSONObject current,@NotNull String ncnumber){
        String num = current.getObject(ncnumber, String.class);
        JSONObject result = new APIJSONParser(GET, true).parseResponse(
                new JSONRequest("Nc_process",new apijson.JSONObject("").puts("ncnumber", num))
        );
        return result;
    }

}
